<script setup>
import { getCurrentInstance, h, onMounted, ref, watch } from "vue";
// import api from "@/request/apis.js";
import 'jsoneditor/dist/jsoneditor.min.css';
import Flow from '@/views/process/engine/index.vue'
import processRelationApi from '@/api/process/processRelationApi'

const props = defineProps(["bizId", "bizType"]);
onMounted(() => {
	queryProcessInfo();
});

watch(() => props.bizId, (newValue, oldValue, onCleanup) => {
	queryProcessInfo();
}, {
	deep: true
});

const gridValue = ref([]);
const queryProcessInfo = async () => {
	if (!props.bizId) {
		return
	}
	const c = await processRelationApi.queryProcessVersionRelationListByBizIdAndType(props.bizId, props.bizType);
	gridValue.value = c;
}

</script>

<template>
	<a-card v-for="(value, sunIndex) in gridValue" :key="sunIndex" class="mb-2">
		<Flow :id="value.id" :params="value.params" :out-run-flag="true"></Flow>
	</a-card>
</template>

<style scoped></style>
